package com.itheima.controller;


import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.entity.Result;
import com.itheima.pojo.Menu;
import com.itheima.service.UserAndMenusSrevcie;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RequestMapping("/userAndMenus")
@Slf4j
@RestController

public class UserAndMenusController {

    @Reference
    UserAndMenusSrevcie userAndMenusSrevcie;


    @RequestMapping("/menus")
    public Result UserAndMenus(String username){

 log.debug("+++++++++++++++++++++++++++++++++++++++"+username);
       List<Map<String,Object>> list = userAndMenusSrevcie.findAll(username);

        return new Result(true,"菜单显示成功",list);
    }

}
